package mogiksaop.qliphoth.common.items;

import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

import mogiksaop.qliphoth.client.lib.LibResources;
import mogiksaop.qliphoth.client.render.IModelRegister;
import mogiksaop.qliphoth.common.core.QliphothCreativeTab;
import mogiksaop.qliphoth.common.lib.LibMisc;

import javax.annotation.Nonnull;

public abstract class ItemMod extends Item implements IModelRegister {

	public ItemMod(String name) {
		setCreativeTab(QliphothCreativeTab.INSTANCE);
		setRegistryName(new ResourceLocation(LibMisc.MOD_ID, name));
		//setRegistryName(name);
		setTranslationKey(name);
		//setUnlocalizedName(name);
	}

	/*@Nonnull
	@Override
	public String getUnlocalizedNameInefficiently(@Nonnull ItemStack par1ItemStack) {
		return super.getUnlocalizedNameInefficiently(par1ItemStack).replaceAll("item\\.", "item." + LibResources.PREFIX_MOD);
	}*/

	@SideOnly(Side.CLIENT)
	@Override
	public void registerModels() {
		ModelLoader.setCustomModelResourceLocation(this, 0, new ModelResourceLocation(getRegistryName(), "inventory"));
	}
}